package com.zhida.jiyangcenter.api

import chooongg.base.manager.app
import chooongg.http.HttpManager
import com.vehicle.inspection.api.BaseTokenInterceptor
import com.zhida.jiyangcenter.utils.SP
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface APICoupon {
    companion object {
        fun service() =
            HttpManager.create(app.applicationContext, "http://beauty.hebzd.com/api/coupon_apps/") {
                addConverterFactory(GsonConverterFactory.create())
                addInterceptor("coupon", BaseTokenInterceptor())
            }.getAPI(APICoupon::class.java)
    }

    /**
     *3、优惠券-领券中心
     */
    @POST("coupon_list")
    @FormUrlEncoded
    suspend fun couponList(
        @Field("identification") identification: String
    ): NetResponse<List<CouponListEntity>>

    /**
     *优惠券领取
     */
    @POST("get_coupon")
    @FormUrlEncoded
    suspend fun getCoupon(
        @Field("coupon_id") coupon_id: String
    ): NetResponse<Any>

  /**
     *我的优惠券
     */
    @POST("user_coupon")
    @FormUrlEncoded
    suspend fun userCoupon(
        @Field("identification") identification: String
    ): NetResponse<List<CouponListEntity>>

}